package com.duan.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.duan.config.UserInfoGenderConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author db
 * @version 1.0
 * @description User
 * @since 2024/7/1
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "user")
public class User implements Serializable {
    private static final long serialVersionUID = 767991252105621235L;

    @TableId
    @ExcelProperty(value = "id")
    private Integer id;

    @ExcelProperty(value = "用户名")
    @TableField("user_name")
    private String userName;

    @ExcelProperty(value = "密码")
    private String password;

    @ExcelProperty(index = 3,converter = UserInfoGenderConverter.class)
    private Integer gender;

    @ExcelProperty(index = 4)
    private String email;

    @ExcelProperty(value = "创建日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ExcelProperty(value = "更新日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}
